<?=isset($header) ? $header : ''?>

<script src="/js/role.js"></script>

<div id="content">
	<div class="form_style">
		<div id="userinfo">
		<table>
			<tbody>
				<tr>
				<th>權限</th>
				<th>部門</th>
				
				<th>機密等級</th>
				<th>是否公開</th>
				<th>重要性</th>
				<th>遮蔽</th>
				
				<th>說明</th>
				<th>操作</th>
				</tr>

				<?php
				
				foreach($role as $key=>$val){
					if($val->role_name!='超級管理员'){
				?>
					<tr>
					<td><?=$val->role_name?></td>
					<td><?=$val->department_name?></td>
					
					
					<td>
						
						<select name="secret_level" id="sercet_level"  class="<?=$val->role_id?>">	
							<option value="1" <?=($val->sercet_level==1)?" SELECTED ":''?> >普通</option>						
							<option value="3" <?=($val->sercet_level==3)?" SELECTED ":''?>>極機密</option>
							<option value="2" <?=($val->sercet_level==2)?" SELECTED ":''?>>機密</option>														
						</select>								
					</td>
					
					<td>
						<select name="is_public" id="is_public" class="<?=$val->role_id?>" >														
							<option value="Y" <?=($val->is_public=="Y")?" SELECTED ":''?>>公開</option>
							<option value="N" <?=($val->is_public=="N")?" SELECTED ":''?>>不公開</option>							
						</select>
					</td>
					
					<td>
						<select name="important" id="important" class="<?=$val->role_id?>">
							<option value="1" <?=($val->important==1)?" SELECTED ":''?> >普通</option>								
							<option value="3" <?=($val->important==3)?" SELECTED ":''?> >極重要</option>
							<option value="2" <?=($val->important==2)?" SELECTED ":''?> >重要</option>
													
						</select>
					</td>
					
					<td>
						<select name="is_see" id="is_see" class="<?=$val->role_id?>">														
							<option value="2" <?=($val->is_see=="2")?" SELECTED ":''?> >遮蔽</option>
							<option value="1" <?=($val->is_see=="1")?" SELECTED ":''?>>不遮蔽</option>							
						</select>
					</td>
					
					
					<td><?=$val->description?></td>
					<td><?php //if($val->role_name!='超級管理员'){ ?>
						<a href="<?=site_url('/role/purview/'.$val->role_id)?>">[設置權限]</a>&nbsp;<a href="<?=site_url('/role/edit/'.$val->role_id)?>">[編輯]</a>&nbsp;<a href="<?=site_url('/role/delete/'.$val->role_id)?>">[刪除]</a>
						<?php //} ?>
					</td>
					</tr>
				<? 
					}
				}
				 ?>

				<tr>
					<td colspan="5"><a href="<?=site_url('/role/add')?>" class="a_background">添加權限</a></td>
				</tr>
			</tbody>
		</table>
		</div>
		<!-- role end -->
	</div>
</div>
<?=isset($footer) ? $footer : ''?>